package com.ilancuo.java8.optional;

import java.util.HashMap;

public class UserUtil {

    public static HashMap<Integer, User> hashMap;

    UserUtil(HashMap<Integer, User> hashMap) {
        UserUtil.hashMap = hashMap;
    }

    public static User getUserByUserId(Integer id) {
        User user = hashMap.get(id);
        System.out.println(user);
        return user;
    }
}
